home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / destruct < prev    next >
Text File  |  2001-04-06  |  2KB  |  41 lines

  1. SYNOPSIS
  2.         void destruct(object ob)
  3.  
  4. DESCRIPTION
  5.         Completely destroy and remove object ob (if not already done so).
  6.         After the call to destruct(), no global variables will exist any
  7.         longer, only local ones, and arguments.
  8.         
  9.         If an object self-destructs, it will not immediately terminate
  10.         execution. If the efun this_object() will be called by the
  11.         destructed object, the result will be 0.
  12.         
  13.         To keep things consistent, most mudlibs frown upon the
  14.         destruct()ion of other objects, and instead demand call_others
  15.         to a specific lfun in the object to destruct (traditionally
  16.         named "remove"). This will then ensure correct update of e.g.
  17.         weights, volumes etc.
  18.  
  19.         The interpreter does not really destruct the object
  20.         immediately, but marks it as deleted, removes it from the list
  21.         of all objects, and puts it onto a list of to-be-destructed
  22.         objects. The actual freeing occurs only when all references to
  23.         a destructed object have gone. Thus it is possible, that an
  24.         object occupies memory long after it has been destructed,
  25.         although the object is not visible anywhere anymore from
  26.         outside.
  27.  
  28. EXAMPLE
  29.         ob->remove();
  30.         if(ob)        /* still there, probably ob does not provide remove() */
  31.            destruct(ob);
  32.         
  33.         This is a way of destructing an object but giving it a chance
  34.         to do it by itself.
  35.  
  36. HISTORY
  37.         Changed in 3.2.7 to accept destructed objects as argument, too.
  38.  
  39. SEE ALSO
  40.         clone_object(E), remove(A)
  41.